#ifndef CONTROLLER_H
#define CONTROLLER_H
#define DEBUG

#include <string>

using namespace std;


//create database based on map with images and annotated word files
void train(string imagesPath, string inputWordsPath, string outputDatabaseName);

//classify single image using lines file and database
void recognize(string databaseName, string imageName, string inputLineName, string outputWordsName);

//test the performance by comparing the generated output and the correct output
void test(string inputWordsPath, string outputWordsPath, bool matchcontent);

//run everything
void runAll(); //see this function for example calls
void runParameterLoop();
void setConfigFile(string configFileName);
string getNFoldDatabaseName(int n, int number);
string getNFoldOutputFolderName(int n, int number);
bool isInNthTestSet(int n, int nIndex, int index);
void trainNFold(string imagesPath, string inputWordsPath, int n);
void testNFold(int n, bool matchcontent);
void runAllNFold(int n);
void saveDatabaseFeaturesAsCSV();
void saveDatabaseFeatureHistogramsAsCSV();
void writeToResult(string result);
#endif
